<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>带电粒子和中性粒子</title>
  <link rel="stylesheet" href="/static/css/bootstrap.min.css">
  <link rel="stylesheet" href="/static/css/bbfont.css">
  <link rel="stylesheet" href="/static/css/style.css">
  <link rel="stylesheet" href="qv.css">
  <style>
    .realtime > div {
      flex-grow: 1;
      position: relative;
    }

    .realtime {
      padding: 5px
    }

    .realtime > div > div {
      background: #FFF;
      position: absolute;
      /*height: 100%;*/
      left: 5px;
      right: 5px;
      top: 5px;
      bottom: 5px;
      overflow-y: auto;
    }

    .realtime header {
      padding: 5px 10px;
      background: darkcyan;
      color: #Fff
    }

    .realtime table th, .realtime table td {
      padding: 2px 5px !important;
    }
  </style>
</head>
<body id="viewer" class="M1">
<div id="CCC" style="padding: 4px 6px;">
  <a class="d-inline-block btn btn-dark history" onclick="main.realtime()">实时</a>
  <a class="d-inline-block btn btn-dark realtime" onclick="main.history()">回放</a>
  日期:
  <input id="day" type="date" value="">
  任务:
  <select id="task" class="sele-comp">
    <option value="sci">科学数据头</option>
    <option value="tia">热离子分析仪（TIA）</option>
    <option value="tea">热电子分析仪（TEA）</option>
    <option value="gia">气体与离子分析仪（GIA）</option>
  </select>
  <span class="history">
    时间: <input type="datetime-local">-<input type="datetime-local">
    仪器:
    <select id="modes" class="sele-comp"></select>
    <label id="frm_max" hidden></label>
    <input id="frm_input" hidden><input id="frm_range" hidden>
    GIA 区域: <input id="gia_range" value="0,8192,64" title="开始,结束,合并间隔" placeholder="start,end,step">
    <button class="btn btn-primary btn-sm" onclick="main.hist()"> 重新绘制</button>
  </span>


</div>
<div class="w-100 position-relative" style="height: calc(100vh - 33px)">
  <div class="history h-100">
    <img class="h-100 m-auto" alt="" src="#">
  </div>
  <div class="realtime h-100 d-flex flex-row">
    <div class="sci">
      <div>
        <header>科学数据头</header>
        <table class="table small"></table>
      </div>
    </div>
    <div class="tia">
      <div>
        <header>热离子分析仪（TIA）</header>
        <table class="table small "></table>
      </div>
    </div>
    <div class="tea">
      <div>
        <header>热电子分析仪（TEA）</header>
        <table class="table small "></table>
      </div>
    </div>
    <div class="gia">
      <div>
        <header>气体与离子分析仪（GIA）</header>
        <table class="table small "></table>
      </div>
    </div>
    <div class="sia">
      <div>
        <header>太阳风离子分析仪（SIA）</header>
        <table class="table small "></table>
      </div>
    </div>
  </div>
</div>
<script src="/static/js/jquery-3.6.0.min.js"></script>
<script src="/static/js/xtool.js?12"></script>
<script src="qv.js"></script>
<script>
  Object.prototype.items = function (callback) {
    return Object.entries(this).map(callback)
  }
  const PARAMS = {
    sci: [
{n: "同步码", k: "syn",v: new RawFmt(4).X, r:'4X'},
{n: "仪器标识", k: "id"},
{n: "源包帧序号", k: "sfc"},
 {n: "时间码", k: "time", v: BJT},
{n: "仪器工作状态", k: "IS"},
{n: "DPU正确指令计数", k: "DPU_CCC"},
{n: "DPU指令代码", k: "DPU_code"},
{n: "平台状态信息", k: "PS", v: v=>v.join(',')},
{n: "+A1.5V电压检测", k: "+A1.5V", v: XFMT_Fixed(), r: '2X'},
{n: "+A3.3V电压检测", k: "+A3.3V", v: XFMT_Fixed(), r: '2X'},
{n: "+A12V电压检测", k: "+A12V", v: XFMT_Fixed(), r: '2X'},
{n: "-A12V电压检测", k: "-A12V", v: XFMT_Fixed(), r: '2X'},
{n: "TIA温度检测", k: "TIA_Tpr", v: XFMT_Fixed(), r: '2X'},
{n: "TEA温度检测", k: "TEA_Tpr", v: XFMT_Fixed(), r: '2X'},
{n: "SIA温度检测", k: "SIA_Tpr", v: XFMT_Fixed(), r: '2X'},
{n: "备份通道", k: "back_chn", r: '2X'},
// <tr><th colspan="2"></th></tr>
{n: "GIA+1.5V检测", k: "GIA+1.5V", v: XFMT_Fixed(), r: '2X'},
{n: "GIA+3.3V检测", k: "GIA+3.3V", v: XFMT_Fixed(), r: '2X'},
{n: "GIA MCP高压检测", k: "GIA_MCP_HV", v: XFMT_Fixed(), r: '2X'},
// <tr><th colspan="2"></th></tr>
{n: "TIA MCP高压检测", k: "TIA_MCP_HV", v: XFMT_Fixed(), r: '2X'},
{n: "TIA+3.3V电源检测", k: "TIA+3.3v", v: XFMT_Fixed(), r: '2X'},
{n: "TIA+1.5V电源检测", k: "TIA+1.5v", v: XFMT_Fixed(), r: '2X'},
// <tr><th colspan="2"></th></tr>
{n: "TEA MCP高压检测", k: "TEA_MCP_HV", v: XFMT_Fixed(), r: '2X'},
{n: "TEA+3.3V电源检测", k: "TEA+3.3V", v: XFMT_Fixed(), r: '2X'},
{n: "TEA+1.5V电源检测", k: "TEA+1.5V", v: XFMT_Fixed(), r: '2X'},
// <tr><th colspan="2"></th></tr>
{n: "SIA+1.5V电源检测", k: "SIA+1.5V", v: XFMT_Fixed(), r: '2X'},
{n: "SIA+3.3V电源检测", k: "SIA+3.3V", v: XFMT_Fixed(), r: '2X'},
{n: "SIA正主高压监测", k: "SIA+M_HV", v: XFMT_Fixed(), r: '2X'},
    ],
    gia: [
 {n: "时间码", k: "time", v: BJT},
{n: "工作状态", k: "status", r: '2X'},
{n: "正确指令计数", k: "CCC", r: '2X'},
{n: "指令代码", k: "code", r: '2X'},
{n: "参数表地址", k: "PT_addr", v: v=>fmtHEX(v,6),r: '6X'},
{n: "灯丝电路状态设定", k: "FCS", r: '2X'},
{n: "飞行时间测量范围设定", k: "FTMR", r: '2X'},
{n: "门控高压使能时间设定", k: "ghv_enable_time", r: '2X'},
{n: "门控高压禁止时间设定", k: "ghv_disable_time", r: '2X'},
{n: "门控高压死区时间设定", k: "ghv_dead_time", r: '2X'},
{n: "GIA SLOT个数设定", k: "sc", r: '2X'},
{n: "周期参数设定", k: "cycle_param", r: '2X'},
{n: "科学数据检测", k: "sdd", r: '2X'},
<tr><th colspan="2"></th></tr>
{n: "幅度超限次数设置", k: "amplitude_exceed", r: '2X'},
{n: "幅度上限阈值", k: "amplitude_upper", r: '2X'},
{n: "幅度下限阈值", k: "amplitude_lower", r: '2X'},
{n: "模拟量工程参数序号", k: "param_index", r: '2X'},
{n: "+1.5V电源检测", k: "+1.5V", v: XFMT_Fixed(), r: '2X'},
{n: "+3.3V电源检测", k: "+3.3V", v: XFMT_Fixed(), r: '2X'},
{n: "+12V电源检测", k: "+12V", v: XFMT_Fixed(), r: '2X'},
{n: "-12V电源检测", k: "-12V", v: XFMT_Fixed(), r: '2X'},
{n: "+24V电源检测", k: "+24V", v: XFMT_Fixed(), r: '2X'},
{n: " 5V电源检测", k: "+5V", v: XFMT_Fixed(), r: '2X'},
{n: "门控高压电流检测", k: "GHI", v: XFMT_Fixed(), r: '2X'},
{n: "门控高压检测", k: "GHV", v: XFMT_Fixed(), r: '2X'},
{n: "负主高压电流检测", k: "nMHI", v: XFMT_Fixed(), r: '2X'},
{n: "负主高压检测", k: "nMHV", v: XFMT_Fixed(), r: '2X'},
{n: "正主高压检测", k: "pMHV", v: XFMT_Fixed(), r: '2X'},
{n: " MCP高压检测", k: "MPC_HV", v: XFMT_Fixed(), r: '2X'},
{n: "灯丝电压检测", k: "F_V", v: XFMT_Fixed(), r: '2X'},
{n: "栅网电压检测", k: "grid_V", v: XFMT_Fixed(), r: '2X'},
{n: "比较器阈值检测", k: "comparator", v: XFMT_Fixed(), r: '2X'},
{n: "漂移管和引出透镜的高压检测", k: "DTL_HV", v: XFMT_Fixed(), r: '2X'},
{n: "发射极1234高压检测", k: "emit1234_HV", v: XFMT_Fixed(), r: '2X'},
{n: "发射极56高压检测", k: "emit56_HV", v: XFMT_Fixed(), r: '2X'},
{n: "前放阈值检测", k: "preamp", v: XFMT_Fixed(), r: '2X'},
{n: "灯丝发射检测", k: "FE", v: XFMT_Fixed(), r: '2X'},
{n: "灯丝阴极检测CH", k: "FC_CH", v: XFMT_Fixed(), r: '2X'},
{n: "灯丝电源检测LV12", k: "FP_LV12", v: XFMT_Fixed(), r: '2X'},
{n: "传感器温度检测", k: "ST", v: XFMT_Fixed(), r: '2X'},
{n: "头部电极2345高压检测", k: "HE2345_HV", v: XFMT_Fixed(), r: '2X'},
    ],
    tia: [
{n: "时间码", k: "time", v: BJT},
{n: "工作状态标志", k: "status", r: '2X'},
{n: "正确指令计数", k: "CCC", r: '2X'},
{n: "指令代码", k: "code", r: '2X'},
{n: "参数表地址", k: "PT_addr", v: v=>fmtHEX(v,6),r: '6X'},
{n: "质量组查找表地址", k: "QT_addr", v: v=>fmtHEX(v,6),r: '6X'},
{n: "方位角查找表地址", k: "AT_addr", v: v=>fmtHEX(v,6),r: '6X'},
{n: "离子质量组个数", k: "MC", r: '2X'},
{n: "离子方位角个数", k: "AC", r: '2X'},
{n: "离子俯仰角个数", k: "PC", r: '2X'},
{n: "离子能道个数", k: "EC", r: '2X'},
{n: "飞行时间测量范围设定", k: "FTMR", r: '2X'},
{n: "wait_slot", k: "wait_slot", r: '2X'},
{n: "无损压缩参考字节", k: "ref_byte", r: '2X'},
{n: "SLOT时间设定", k: "STS", r: '2X'},
{n: "SLOT个数设定", k: "slot_C", r: '2X'},
{n: "周期参数设定", k: "PPS", r: '2X'},
{n: "科学数据检测", k: "SDT", r: '2X'},
// <tr><th colspan="2"></th></tr>
{n: "模拟量工程参数序号", k: "AEPI", r: '2X'},
{n: "+1.5V电源检测", k: "+1.5V", v: XFMT_Fixed(), r: '2X'},
{n: "+3.3V电源检测", k: "+3.3V", v: XFMT_Fixed(), r: '2X'},
{n: "+5V电源检测", k: "+5V", v: XFMT_Fixed(), r: '2X'},
{n: "+12V电源检测", k: "+12V", v: XFMT_Fixed(), r: '2X'},
{n: "-12V电源检测", k: "-12V", v: XFMT_Fixed(), r: '2X'},
{n: "+24V电源检测", k: "+24V", v: XFMT_Fixed(), r: '2X'},
{n: "-24V电源检测", k: "-24V", v: XFMT_Fixed(), r: '2X'},
{n: "负主高压检测", k: "nMHV", v: XFMT_Fixed(), r: '2X'},
{n: "负主高压电流检测", k: "nMHI", v: XFMT_Fixed(), r: '2X'},
{n: "微通道板高压检测", k: "MCP_HV", v: XFMT_Fixed(), r: '2X'},
{n: "上扫描电压检测DF1", k: "UCV_df1", v: XFMT_Fixed(), r: '2X'},
{n: "下扫描电压检测DF2", k: "LCV_df2", v: XFMT_Fixed(), r: '2X'},
{n: "静电分析器电压检测ESA", k: "ESAV", v: XFMT_Fixed(), r: '2X'},
{n: "门控高压低端检测", k: "GLV", v: XFMT_Fixed(), r: '2X'},
{n: "门控高压电流检测", k: "GHI", v: XFMT_Fixed(), r: '2X'},
{n: "门控高压检测", k: "GHV", v: XFMT_Fixed(), r: '2X'},
    ],
    tea: [
{n: "时间码", k: "time", v: BJT},
{n: "工作状态标志", k: "status", r: '2X'},
{n: "正确指令计数", k: "CCC", r: '2X'},
{n: "指令代码", k: "code", r: '2X'},
{n: "参数表地址", k: "PT_addr", v: v=>fmtHEX(v,6),r: '6X'},
{n: "wai_slot及无损压缩参考字节", k: "wai_slot", r: '2X'},
{n: "wai_slot及无损压缩参考字节", k: "ref_byte", r: '2X'},
{n: "电子方位角个数", k: "AC", r: '2X'},
{n: "电子俯仰角个数", k: "PC", r: '2X'},
{n: "电子能道个数", k: "EC", r: '2X'},
{n: "飞行时间测量范围设定", k: "flight_time_measurement_range", r: '2X'},
{n: "SLOT时间设定", k: "slot_time_setting", r: '2X'},
{n: "SLOT个数设定", k: "slot_count", r: '2X'},
{n: "周期参数设定", k: "cycle_param", r: '2X'},
{n: "科学数据检测", k: "science_data_detection", r: '2X'},
{n: "模拟量工程参数序号", k: "analog_engineering_param_index", r: '2X'},
// {n: "", k: "_",v: v=>''},
{n: "+1.5V电源检测", k: "+1.5V", v: XFMT_Fixed(), r: '2X'},
{n: "+3.3V电源检测", k: "+3.3V", v: XFMT_Fixed(), r: '2X'},
{n: "+5V电源检测", k: "+5V", v: XFMT_Fixed(), r: '2X'},
{n: "+12V电源检测", k: "+12V", v: XFMT_Fixed(), r: '2X'},
{n: "-12V电源检测", k: "-12V", v: XFMT_Fixed(), r: '2X'},
{n: "+24V电源检测", k: "+24V", v: XFMT_Fixed(), r: '2X'},
{n: "备用通道数据", k: "spare_channel_data", v: XFMT_Fixed(), r: '2X'},
{n: "正主高压检测", k: "pMHV", v: XFMT_Fixed(), r: '2X'},
{n: "正主高压电流检测", k: "pMNI", v: XFMT_Fixed(), r: '2X'},
{n: "微通道板高压检测", k: "MCP_HV", v: XFMT_Fixed(), r: '2X'},
{n: "上扫描电压检测DF1", k: "UCV_df1", v: XFMT_Fixed(), r: '2X'},
{n: "下扫描电压检测DF2", k: "LCV_df2", v: XFMT_Fixed(), r: '2X'},
{n: "静电分析器电压检测ESA", k: "ESAV", v: XFMT_Fixed(), r: '2X'},
    ],
    sia: [
 {n: "时间码", k: "time", v: BJT},
{n: "工作状态", k: "status", r: '2X'},
{n: "正确指令计数", k: "correct_cmd_count", r: '2X'},
{n: "指令代码", k: "cmd_code", r: '2X'},
{n: "参数表地址", k: "PT_addr", v: v=>fmtHEX(v,6),r: '6X'},
{n: " SLOT时间", k: "slot_time", r: '2X'},
{n: " SLOT个数", k: "slot_count", r: '2X'},
{n: "高压脉冲参数设置", k: "high_voltage_pulse_param", r: '2X'},
{n: "模拟量工程参数序号", k: "analog_engineering_param_index", r: '2X'},
// <tr><th colspan="2"></th></tr>
{n: "科学数据通道1电压检测", k: "SDC_1V", v: XFMT_Fixed(), r: '2X'},
{n: "科学数据通道2电压检测", k: "SDC_2V", v: XFMT_Fixed(), r: '2X'},
{n: "科学数据通道3电压检测", k: "SDC_3V", v: XFMT_Fixed(), r: '2X'},
{n: "科学数据通道4电压检测", k: "SDC_4V", v: XFMT_Fixed(), r: '2X'},
{n: "科学数据通道5电压检测", k: "SDC_5V", v: XFMT_Fixed(), r: '2X'},
{n: "主高压PHV检测", k: "MH_PHV", v: XFMT_Fixed(), r: '2X'},
{n: "扫描高压检测", k: "SHV", v: XFMT_Fixed(), r: '2X'},
{n: "+12V电压检测", k: "+12V", v: XFMT_Fixed(), r: '2X'},
{n: "-12V电压检测", k: "-12V", v: XFMT_Fixed(), r: '2X'},
{n: "+3.3V电源检测", k: "+3.3V", v: XFMT_Fixed(), r: '2X'},
{n: "+2.5V电源检测", k: "+2.5V", v: XFMT_Fixed(), r: '2X'},
{n: "+24V电压检测", k: "+24V", v: XFMT_Fixed(), r: '2X'},
{n: "高压电流检测", k: "HVC", v: XFMT_Fixed(), r: '2X'},
{n: "+5V电源检测", k: "+5V", v: XFMT_Fixed(), r: '2X'},
{n: "抑制高压检测", k: "sup_HV", v: XFMT_Fixed(), r: '2X'},
    ],
  }

  class XView extends Realtime {
    constructor() {
      super('CANPA', $STATION)
      this._params = Object.keys(PARAMS).reduce((acc, k)=>{
        acc[k] = PARAMS[k].map($param())
        return acc
      },{})
      this.$sci = $$('.sci table')
      this.$gia = $$('.gia table')
      this.$tia = $$('.tia table')
      this.$tea = $$('.tea table')
      this.$sia = $$('.sia table')
      this.$hst = $('.history');
      this.$rlt = $('.realtime');
      this.$modes = $('#modes');
      this.modes = {}
      this.$modes.change(this.hist.bind(this))
      this.$dates = $$$('[type="datetime-local"]')
    }
    renderMode() {
      // return super.renderMode();
    }

    get mode() {
      return 'tia';
    }

    async load_frames(task) {
      await super.load_frames(task);
      if (this.frames_ori.length) {
        this.modes = {}
        this.frames_ori.map(fr => {
          let i = fr.info;
          ['gia', 'tia', 'tea', 'sia'].forEach(v => {
            let p = v ;// + '-' + i[v]['PT_addr'].toString(16).padStart(6, '0')
            this.modes[p] = (this.modes[p] || 0) + 1
          })
          this.$modes.html(this.modes.items(([k, n]) => `<option value="${k}">${k.toUpperCase()}: ${n}</option>`))
        })
        this.$dates[0].value = BJT(this.frames_ori[0].st)
        this.$dates[1].value = BJT(this.frames_ori[this.frames_ori.length - 1].st)
      }
    }

    async hist() {
      this.cur_task = '/OMSDATA-TW2/OriginalData/GRAS/GRAS4/20241225_00012_000/CANPA'
      let mo = this.$modes.val()
      if (mo.includes('gia')) mo = mo + '&slice=' + $$('#gia_range').value
      let x = new Date().getMilliseconds();
      let s = new Date(this.$dates[0].value + '+0800').getTime()
      let e = new Date(this.$dates[1].value + '+0800').getTime()
      $$('.history img').src = `/-/omsp.canpa?t=${this.cur_task}&mode=${mo}&s=${s}&e=${e}&x=${x}`
    }

    async history() {
      await super.history();
      // await this.load_frames(this.cur_task)
      this.$rlt.hide()
      this.$hst.show()
      await this.hist()
    }

    realtime() {
      super.realtime();
      this.$hst.hide()
      this.$rlt.show()
    }

    async newframe(d) {
      await super.newframe(d);
      this.show_frame(d)
    }

    show_frame(msg) {
      let d = msg.info
      let v = d;
      this.$sci.innerHTML = `
<tr><th>同步码</th><td>${v['syn']}</td></tr>
{n: "仪器标识", k: "id"},
<tr><th>源包帧序号</th><td>${v['sfc']}</td></tr>
<tr><th colspan="2">时间码 <span style="float:right">${BJT(v['time'])}<span></th></tr>
<tr><th>仪器工作状态</th><td>${v['IS']}</td></tr>
<tr><th>DPU正确指令计数</th><td>${v['DPU_CCC']}</td></tr>
<tr><th>DPU指令代码</th><td>${v['DPU_code']}</td></tr>
<tr><th>平台状态信息</th><td title="${v['PS']}">${v['PS'].join(',').slice(0, 10)}...</td></tr>
<tr><th>+A1.5V电压检测</th><td>${FMT_Fixed(v['+A1.5V'])}</td></tr>
<tr><th>+A3.3V电压检测</th><td>${FMT_Fixed(v['+A3.3V'])}</td></tr>
<tr><th>+A12V电压检测</th><td>${FMT_Fixed(v['+A12V'])}</td></tr>
<tr><th>-A12V电压检测</th><td>${FMT_Fixed(v['-A12V'])}</td></tr>
<tr><th>TIA温度检测</th><td>${FMT_Fixed(v['TIA_Tpr'])}</td></tr>
<tr><th>TEA温度检测</th><td>${FMT_Fixed(v['TEA_Tpr'])}</td></tr>
<tr><th>SIA温度检测</th><td>${FMT_Fixed(v['SIA_Tpr'])}</td></tr>
<tr><th>备份通道</th><td>${v['back_chn']}</td></tr>
<tr><th colspan="2"></th></tr>
<tr><th>GIA+1.5V检测</th><td>${FMT_Fixed(v['GIA+1.5V'])}</td></tr>
<tr><th>GIA+3.3V检测</th><td>${FMT_Fixed(v['GIA+3.3V'])}</td></tr>
<tr><th>GIA MCP高压检测</th><td>${FMT_Fixed(v['GIA_MCP_HV'])}</td></tr>
<tr><th colspan="2"></th></tr>
<tr><th>TIA MCP高压检测</th><td>${FMT_Fixed(v['TIA_MCP_HV'])}</td></tr>
<tr><th>TIA+3.3V电源检测</th><td>${FMT_Fixed(v['TIA+3.3v'])}</td></tr>
<tr><th>TIA+1.5V电源检测</th><td>${FMT_Fixed(v['TIA+1.5v'])}</td></tr>
<tr><th colspan="2"></th></tr>
<tr><th>TEA MCP高压检测</th><td>${FMT_Fixed(v['TEA_MCP_HV'])}</td></tr>
<tr><th>TEA+3.3V电源检测</th><td>${FMT_Fixed(v['TEA+3.3V'])}</td></tr>
<tr><th>TEA+1.5V电源检测</th><td>${FMT_Fixed(v['TEA+1.5V'])}</td></tr>
<tr><th colspan="2"></th></tr>
<tr><th>SIA+1.5V电源检测</th><td>${FMT_Fixed(v['SIA+1.5V'])}</td></tr>
<tr><th>SIA+3.3V电源检测</th><td>${FMT_Fixed(v['SIA+3.3V'])}</td></tr>
<tr><th>SIA正主高压监测</th><td>${FMT_Fixed(v['SIA+M_HV'])}</td></tr>`
      v = d.gia || {};
      this.$gia.innerHTML = `
<tr><th colspan="2">时间码 <span style="float:right">${BJT(v['time'])}<span></th></tr>
<tr><th>工作状态</th><td>${v['status']}</td></tr>
<tr><th>正确指令计数</th><td>${v['CCC']}</td></tr>
<tr><th>指令代码</th><td>${v['code']}</td></tr>
<tr><th>参数表地址</th><td>${fmtHEX(v['PT_addr'], 6)}</td></tr>
<tr><th>灯丝电路状态设定</th><td>${v['FCS']}</td></tr>
<tr><th>飞行时间测量范围设定</th><td>${v['FTMR']}</td></tr>
<tr><th>门控高压使能时间设定</th><td>${v['ghv_enable_time']}</td></tr>
<tr><th>门控高压禁止时间设定</th><td>${v['ghv_disable_time']}</td></tr>
<tr><th>门控高压死区时间设定</th><td>${v['ghv_dead_time']}</td></tr>
<tr><th>GIA SLOT个数设定</th><td>${v['sc']}</td></tr>
<tr><th>周期参数设定</th><td>${v['cycle_param']}</td></tr>
<tr><th>科学数据检测</th><td>${v['sdd']}</td></tr>
<tr><th colspan="2"></th></tr>
<tr><th>幅度超限次数设置</th><td>${v['amplitude_exceed']}</td></tr>
<tr><th>幅度上限阈值</th><td>${v['amplitude_upper']}</td></tr>
<tr><th>幅度下限阈值</th><td>${v['amplitude_lower']}</td></tr>
<!--        <tr><th>工作参数备用字节9~1</th><td>${v['bk']}</td></tr>-->
<tr><th>模拟量工程参数序号</th><td>${v['param_index']}</td></tr>
<tr><th>+1.5V电源检测</th><td>${FMT_Fixed(v['+1.5V'])}</td></tr>
<tr><th>+3.3V电源检测</th><td>${FMT_Fixed(v['+3.3V'])}</td></tr>
<tr><th>+12V电源检测</th><td>${FMT_Fixed(v['+12V'])}</td></tr>
<tr><th>-12V电源检测</th><td>${FMT_Fixed(v['-12V'])}</td></tr>
<tr><th>+24V电源检测</th><td>${FMT_Fixed(v['+24V'])}</td></tr>
<tr><th> 5V电源检测</th><td>${FMT_Fixed(v['+5V'])}</td></tr>
<tr><th>门控高压电流检测</th><td>${FMT_Fixed(v['GHI'])}</td></tr>
<tr><th>门控高压检测</th><td>${FMT_Fixed(v['GHV'])}</td></tr>
<tr><th>负主高压电流检测</th><td>${FMT_Fixed(v['nMHI'])}</td></tr>
<tr><th>负主高压检测</th><td>${FMT_Fixed(v['nMHV'])}</td></tr>
<tr><th>正主高压检测</th><td>${FMT_Fixed(v['pMHV'])}</td></tr>
<tr><th> MCP高压检测</th><td>${FMT_Fixed(v['MPC_HV'])}</td></tr>
<tr><th>灯丝电压检测</th><td>${FMT_Fixed(v['F_V'])}</td></tr>
<tr><th>栅网电压检测</th><td>${FMT_Fixed(v['grid_V'])}</td></tr>
<tr><th>比较器阈值检测</th><td>${FMT_Fixed(v['comparator'])}</td></tr>
<tr><th>漂移管和引出透镜的高压检测</th><td>${FMT_Fixed(v['DTL_HV'])}</td></tr>
<tr><th>发射极1234高压检测</th><td>${FMT_Fixed(v['emit1234_HV'])}</td></tr>
<tr><th>发射极56高压检测</th><td>${FMT_Fixed(v['emit56_HV'])}</td></tr>
<tr><th>前放阈值检测</th><td>${FMT_Fixed(v['preamp'])}</td></tr>
<tr><th>灯丝发射检测</th><td>${FMT_Fixed(v['FE'])}</td></tr>
<tr><th>灯丝阴极检测CH</th><td>${FMT_Fixed(v['FC_CH'])}</td></tr>
<tr><th>灯丝电源检测LV12</th><td>${FMT_Fixed(v['FP_LV12'])}</td></tr>
<tr><th>传感器温度检测</th><td>${FMT_Fixed(v['ST'])}</td></tr>
<tr><th>头部电极2345高压检测</th><td>${FMT_Fixed(v['HE2345_HV'])}</td></tr>
    `
      v = d.tia || {};
      this.$tia.innerHTML = `
<tr><th colspan="2">时间码 <span style="float:right">${BJT(v['time'])}<span></th></tr>
<tr><th>工作状态标志</th><td>${v['status']}</td></tr>
<tr><th>正确指令计数</th><td>${v['CCC']}</td></tr>
<tr><th>指令代码</th><td>${v['code']}</td></tr>
<tr><th>参数表地址</th><td>${fmtHEX(v['PT_addr'], 6)}</td></tr>
<tr><th>质量组查找表地址</th><td>${fmtHEX(v['QT_addr'], 6)}</td></tr>
<tr><th>方位角查找表地址</th><td>${fmtHEX(v['AT_addr'], 6)}</td></tr>
<tr><th>离子质量组个数</th><td>${v['MC']}</td></tr>
<tr><th>离子方位角个数</th><td>${v['AC']}</td></tr>
<tr><th>离子俯仰角个数</th><td>${v['PC']}</td></tr>
<tr><th>离子能道个数</th><td>${v['EC']}</td></tr>
<tr><th>飞行时间测量范围设定</th><td>${v['FTMR']}</td></tr>
<tr><th>wait_slot</th><td>${v['wait_slot']}</td></tr>
<tr><th>无损压缩参考字节</th><td>${v['ref_byte']}</td></tr>
<tr><th>SLOT时间设定</th><td>${v['STS']}</td></tr>
<tr><th>SLOT个数设定</th><td>${v['slot_C']}</td></tr>
<tr><th>周期参数设定</th><td>${v['PPS']}</td></tr>
<tr><th>科学数据检测</th><td>${v['SDT']}</td></tr>
<tr><th colspan="2"></th></tr>
<tr><th>模拟量工程参数序号</th><td>${v['AEPI']}</td></tr>
<tr><th>+1.5V电源检测</th><td>${FMT_Fixed(v['+1.5V'])}</td></tr>
<tr><th>+3.3V电源检测</th><td>${FMT_Fixed(v['+3.3V'])}</td></tr>
<tr><th>+5V电源检测</th><td>${FMT_Fixed(v['+5V'])}</td></tr>
<tr><th>+12V电源检测</th><td>${FMT_Fixed(v['+12V'])}</td></tr>
<tr><th>-12V电源检测</th><td>${FMT_Fixed(v['-12V'])}</td></tr>
<tr><th>+24V电源检测</th><td>${FMT_Fixed(v['+24V'])}</td></tr>
<tr><th>-24V电源检测</th><td>${FMT_Fixed(v['-24V'])}</td></tr>
<tr><th>负主高压检测</th><td>${FMT_Fixed(v['nMHV'])}</td></tr>
<tr><th>负主高压电流检测</th><td>${FMT_Fixed(v['nMHI'])}</td></tr>
<tr><th>微通道板高压检测</th><td>${FMT_Fixed(v['MCP_HV'])}</td></tr>
<tr><th>上扫描电压检测DF1</th><td>${FMT_Fixed(v['UCV_df1'])}</td></tr>
<tr><th>下扫描电压检测DF2</th><td>${FMT_Fixed(v['LCV_df2'])}</td></tr>
<tr><th>静电分析器电压检测ESA</th><td>${FMT_Fixed(v['ESAV'])}</td></tr>
<tr><th>门控高压低端检测</th><td>${FMT_Fixed(v['GLV'])}</td></tr>
<tr><th>门控高压电流检测</th><td>${FMT_Fixed(v['GHI'])}</td></tr>
<tr><th>门控高压检测</th><td>${FMT_Fixed(v['GHV'])}</td></tr>
    `
      v = d.tea || {};
      this.$tea.innerHTML = `
<tr><th colspan="2">时间码 <span style="float:right">${BJT(v['time'])}<span></th></tr>
<tr><th>工作状态标志</th><td>${v['status']}</td></tr>
<tr><th>正确指令计数</th><td>${v['CCC']}</td></tr>
<tr><th>指令代码</th><td>${v['code']}</td></tr>
<tr><th>参数表地址</th><td>${fmtHEX(v['PT_addr'], 6)}</td></tr>
<tr><th>wai_slot及无损压缩参考字节</th><td>${v['wai_slot']}</td></tr>
<tr><th>wai_slot及无损压缩参考字节</th><td>${v['ref_byte']}</td></tr>
<tr><th>电子方位角个数</th><td>${v['AC']}</td></tr>
<tr><th>电子俯仰角个数</th><td>${v['PC']}</td></tr>
<tr><th>电子能道个数</th><td>${v['EC']}</td></tr>
<tr><th>飞行时间测量范围设定</th><td>${v['flight_time_measurement_range']}</td></tr>
<tr><th>SLOT时间设定</th><td>${v['slot_time_setting']}</td></tr>
<tr><th>SLOT个数设定</th><td>${v['slot_count']}</td></tr>
<tr><th>周期参数设定</th><td>${v['cycle_param']}</td></tr>
<tr><th>科学数据检测</th><td>${v['science_data_detection']}</td></tr>
<tr><th>模拟量工程参数序号</th><td>${v['analog_engineering_param_index']}</td></tr>
<tr><th colspan="2"></th></tr>
<tr><th>+1.5V电源检测</th><td>${FMT_Fixed(v['+1.5V'])}</td></tr>
<tr><th>+3.3V电源检测</th><td>${FMT_Fixed(v['+3.3V'])}</td></tr>
<tr><th>+5V电源检测</th><td>${FMT_Fixed(v['+5V'])}</td></tr>
<tr><th>+12V电源检测</th><td>${FMT_Fixed(v['+12V'])}</td></tr>
<tr><th>-12V电源检测</th><td>${FMT_Fixed(v['-12V'])}</td></tr>
<tr><th>+24V电源检测</th><td>${FMT_Fixed(v['+24V'])}</td></tr>
<tr><th>备用通道数据</th><td>${FMT_Fixed(v['spare_channel_data'])}</td></tr>
<tr><th>正主高压检测</th><td>${FMT_Fixed(v['pMHV'])}</td></tr>
<tr><th>正主高压电流检测</th><td>${FMT_Fixed(v['pMNI'])}</td></tr>
<tr><th>微通道板高压检测</th><td>${FMT_Fixed(v['MCP_HV'])}</td></tr>
<tr><th>上扫描电压检测DF1</th><td>${FMT_Fixed(v['UCV_df1'])}</td></tr>
<tr><th>下扫描电压检测DF2</th><td>${FMT_Fixed(v['LCV_df2'])}</td></tr>
<tr><th>静电分析器电压检测ESA</th><td>${FMT_Fixed(v['ESAV'])}</td></tr>
    `
      v = d.sia || {};
      this.$sia.innerHTML = `
<tr><th colspan="2">时间码 <span style="float:right">${BJT(v['time'])}<span></th></tr>
<tr><th>工作状态</th><td>${v['status']}</td></tr>
<tr><th>正确指令计数</th><td>${v['correct_cmd_count']}</td></tr>
<tr><th>指令代码</th><td>${v['cmd_code']}</td></tr>
<tr><th>参数表地址</th><td>${fmtHEX(v['PT_addr'], 6)}</td></tr>
<tr><th> SLOT时间</th><td>${v['slot_time']}</td></tr>
<tr><th> SLOT个数</th><td>${v['slot_count']}</td></tr>
<tr><th>高压脉冲参数设置</th><td>${v['high_voltage_pulse_param']}</td></tr>
<!--        <tr><th>SIA备用参数</th><td>${v['spare_params']}</td></tr>-->
<tr><th>模拟量工程参数序号</th><td>${v['analog_engineering_param_index']}</td></tr>
<tr><th colspan="2"></th></tr>
<tr><th>科学数据通道1电压检测</th><td>${FMT_Fixed(v['SDC_1V'])}</td></tr>
<tr><th>科学数据通道2电压检测</th><td>${FMT_Fixed(v['SDC_2V'])}</td></tr>
<tr><th>科学数据通道3电压检测</th><td>${FMT_Fixed(v['SDC_3V'])}</td></tr>
<tr><th>科学数据通道4电压检测</th><td>${FMT_Fixed(v['SDC_4V'])}</td></tr>
<tr><th>科学数据通道5电压检测</th><td>${FMT_Fixed(v['SDC_5V'])}</td></tr>
<tr><th>主高压PHV检测</th><td>${FMT_Fixed(v['MH_PHV'])}</td></tr>
<tr><th>扫描高压检测</th><td>${FMT_Fixed(v['SHV'])}</td></tr>
<tr><th>+12V电压检测</th><td>${FMT_Fixed(v['+12V'])}</td></tr>
<tr><th>-12V电压检测</th><td>${FMT_Fixed(v['-12V'])}</td></tr>
<tr><th>+3.3V电源检测</th><td>${FMT_Fixed(v['+3.3V'])}</td></tr>
<tr><th>+2.5V电源检测</th><td>${FMT_Fixed(v['+2.5V'])}</td></tr>
<tr><th>+24V电压检测</th><td>${FMT_Fixed(v['+24V'])}</td></tr>
<tr><th>高压电流检测</th><td>${FMT_Fixed(v['HVC'])}</td></tr>
<tr><th>+5V电源检测</th><td>${FMT_Fixed(v['+5V'])}</td></tr>
<tr><th>抑制高压检测</th><td>${FMT_Fixed(v['sup_HV'])}</td></tr>
`
    }
  }

  var main = new XView()
  main.realtime()
</script>
</body>
</html>
